package com.qyx.pmpucat.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.Fastjson2TypeHandler;
import com.qyx.pmpucat.entity.base.BaseEntity;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 问卷组实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("t_questionnaire_group")
public class QuestionnaireGroup extends BaseEntity {

    /**
     * 问卷组标题
     */
    @NotBlank(message = "问卷组标题不能为空")
    @Column("title")
    private String title;

    /**
     * 问卷组描述
     */
    @Column("description")
    private String description;

    /**
     * 问卷组状态: 0-未发布, 1-已发布, 2-已下线
     */
    @Column("status")
    private Integer status;

    //问卷集合
    @NotEmpty(message = "问卷组至少需要包含一个问卷")
    @Column(value = "questionnaire_ids",typeHandler =  Fastjson2TypeHandler.class)
    private List<Long> questionnaireIds;
} 